<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>员工管理-
                        <small>查看详情</small>
                    </h5>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" onsubmit="return false">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*姓名</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="<{$data.name}>" id="admin_name" readonly/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*添加时间</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="<{$data.ctime}>" readonly="readonly"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">*客服ID</label>
                            <div class="col-sm-10">
                                <input  class="form-control" type="text" value="<{$data.id}>" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*待回复问题</label>
                            <div class="col-sm-10">
                                <input class="form-control" type="text" value="<{$un_resolve}>" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*已回复问题</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<{$has_back}>" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*已解决问题</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<{$has_resolve}>" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*修改角色</label>
                            <div class="col-sm-10">
                                <select name="rid" id="rid" class="form-control">
                                    <volist name="role" id="vo">
                                        <option value="<{$vo.id}>" <if condition="$data['role_id'] eq $vo['id']">selected</if> ><{$vo.name}></option>
                                    </volist>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">*修改部门</label>
                            <div class="col-sm-10">
                                <select name="apart" id="apart" class="form-control">
                                    <volist name="apart" id="vo">
                                        <option value="<{$vo.id}>" <if condition="$data['part_id'] eq $vo['id']">selected</if> ><{$vo.name}></option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*修改职位</label>
                            <div class="col-sm-10">
                                <input type="text" id="level_position" class="form-control" value="<{$data.level}>" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">*修改状态</label>
                            <div class="col-sm-10">
                                <select name="agenid" id="agenid" class="form-control">
                                    <option value="1" <if condition="$data['status'] eq 1">selected</if> >正常</option>
                                    <option value="2" <if condition="$data['status'] eq 2">selected</if>>禁止</option>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="button" onclick="Edit()">确认修改</button>
                                <button class="btn btn-white" type="button" onclick="self.location=document.referrer;">返回</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/content.js?v=1.0.0"></script>
<script src="/Public/js/plugins/layer/layer.min.js"></script>
<script>

    function select() {
        var v="<{$status}>";
        $("#agenid").val(v);
    }

    function Edit() {
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        var url = "<{$SRVER_NAME}>/admin.php/CustomerService/kefuEditSave";
        var tourl = "<{$SRVER_NAME}>/admin.php/CustomerService/kefuList";
        var name = $("#admin_name").val();
        var duties=$("#level_position").val();
        var status=$("#agenid").val();
        var rid=$("#rid").val();
        var apart=$("#apart").val();
        var id="<{$id}>";
        if (name == "") {
            layer.close(index);
            layer.alert("请信息填写完整！\r\n", {
                title: '提示框',
                icon: 0,
            });
            return false;
        }
        else {

            $.post(url, {id: id, name:name,status:status,role_id:rid,apart:apart,duties:duties}, function (data) {
                if (data.code == "1001") {
                    layer.alert('修改成功', {title: '提示框', icon: 1}, function () {
                        self.location=document.referrer
                        layer.close(index);
                    });
                }
                else {
                    layer.alert('修改失败', {title: '提示框', icon: 2});
                    layer.close(index);
                }
            });
        }
    }

</script>
</body>
</html>
